package com.wu.service.sys;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wu.base.ApiResponse;
import com.wu.entity.sys.SDepartmentDo;
import com.wu.pojo.reqeust.CommonIdRequest;
import com.wu.pojo.reqeust.CommonIdStatusRequest;
import com.wu.pojo.reqeust.sys.DepartmentEditRequest;
import com.wu.pojo.reqeust.sys.DepartmentListRequest;
import com.wu.pojo.reqeust.sys.DepartmentSaveRequest;
import com.wu.pojo.reqeust.sys.DepartmentTreeListRequest;

import java.util.List;

public interface SDepartmentService extends IService<SDepartmentDo> {

    ApiResponse treeList(DepartmentTreeListRequest request);

    ApiResponse list(DepartmentListRequest request);

    ApiResponse optionList(DepartmentTreeListRequest request);

    ApiResponse save(DepartmentSaveRequest request);

    ApiResponse edit(DepartmentEditRequest request);

    ApiResponse delete(CommonIdRequest request);

    ApiResponse onOrOff(CommonIdStatusRequest request);

    ApiResponse getById(CommonIdRequest request);

    ApiResponse treeAndUser(DepartmentTreeListRequest request);

    Long getDepartmentParentIdById(Long id);

    /**
     * 查询子、孙...部门id
     * @param ids
     * @return
     */
    List<Long> getDepartmentSubIdsByIds(List<Long> ids);

    /**
     * 查询与此部门id有关联的部门id(上下级id)
     * @param id
     * @return
     */
    List<Long> getDepartmentConnectionById(Long id);

    /**
     * 查询子部门
     * @param id
     * @return
     */
    List<SDepartmentDo> getDepartmentSonsById(Long id);


}